package com.logicwin.RobotTravel.Screens;

import com.logicwin.RobotTravel.R;
import com.logicwin.RobotTravel.utils.SystemParams;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class ScreenAbout extends Screen {

	public ScreenAbout() {
		super(SCREEN_TYPE.ABOUT_T, ScreenAbout.class.getCanonicalName());
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//keep the screen on
		setContentView(R.layout.screen_about);
		this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

		/*
		 * TextView textView =
		 * (TextView)this.findViewById(R.id.screen_about_textView_copyright);
		 * String copyright = this.getString(R.string.copyright);
		 * 
		 * String text = String.format(copyright, RobotTravel.getVersionName(),
		 * this.getString(R.string.robotTravel_revision));
		 * 
		 * text += "\n"; text += "地址：杭州市拱墅区世贸科技创业园308\n"; text +=
		 * "电话：0571-89901862\n"; text += "手机：13754310860\n"; text +=
		 * "Email: yxerp@163.com\n"; text += "网址：www.21yx.com";
		 * textView.setText(text);
		 */
		RelativeLayout layout = (RelativeLayout) this
				.findViewById(R.id.about_relativeLayout);

		FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) layout
				.getLayoutParams();
		params.width = SystemParams.getWindowWidth(this);
		params.height = SystemParams.getWindowHeight(this);
		layout.setLayoutParams(params);

		ImageView view = (ImageView) this.findViewById(R.id.screen_about);
		Resources res = this.getResources();
		Bitmap image = BitmapFactory.decodeResource(res,
				R.drawable.about);
		// view.setImageBitmap(image);
		view.setImageBitmap(SystemParams.adjustBitmapBasedOnScreen(image, this));
	}
}
